Imprecise Exceptions, Co-Inductively
نویسندگان
چکیده
In a recent paper, Peyton Jones et al. proposed a design for imprecise exceptions in the lazy functional programming language Haskell PJRH + 99]. The main contribution of the design was that it allowed the language to continue to enjoy its current rich algebra of transformations. However, it does not combine easily with other extensions, most notably that of concurrency. We present an alternative semantics for a lazy functional language with imprecise exceptions which is entirely operational in nature, and combines well with other extensions, such as I/O and concurrency. The semantics is based upon a convergence relation, which describes evaluation, and an exceptional convergence relation, which describes the raising of exceptions. Convergence and exceptional convergence lead naturally to a simple notion of reenement, where a term M is reened by N whenever they have identical convergent behaviour, and any exception raised by N can also be raised by M. We are able to validate many call-by-name equivalences and standard program transformations, including the ubiquitous strictness transformation. 1 Introduction In an earlier paper PJRH + 99] we showed how to add exceptions to a lazy, purely-functional programming language, such as Haskell. There were three key ideas. The rst was to treat an exception as a value rather than as a change of control ow. This idea is fairly standard; for example, the IEEE oating point standard uses it for NaNs. The second idea addressed the question of what meaning to assign to expressions like: (raise e1) + (raise e2): Does this expression deliver the exception e1, or e2? The conventional approach is to x the evaluation order, thus determining which of the two exceptions is delivered. This works well for languages whose evaluation order is already highly constrained because of other eeects, such as assignment or input/output. For languages like Haskell, however, code motion that changes evaluation order is a key transformation , and xing the evaluation order would be a major blow. The alternative we advocated in PJRH + 99] is to say
منابع مشابه
Formal Verification of an Intel XScale Processor Model with Scoreboarding, Specialized Execution Pipelines, and Imprecise Data-Memory Exceptions
simulator TLSim [41], takes the specification and impleWe present the formal verification of an Intel XScale processor model. The XScale is a superpipelined RISC processor with 7-stage integer, 8-stage memory, and variable-latency multiply-and-accumulate execution pipelines. The processor uses scoreboarding to track data dependencies, and implements both precise and imprecise exceptions. Such s...
متن کاملImprecise Exceptions in Distributed Parallel Components
Modern microprocessors have sacrificed the exactness of exceptions for improved performance long ago. This is a side effect of reordering instructions so that the microprocessor can execute instructions which were not to be executed due to an exception. By throwing more circuits at the problem, microprocessors are designed so that they are able to roll back to the instruction causing the except...
متن کاملComparing the Imperfect with the Imperfect: The Imprecise Science of Assessing the Risk and Benefits of Anticoagulation in Atrial Fibrillation Running title: Tan et al.; The Imprecise Science of Assessing Anticoagulation
Ad Ad ddr dr dres es ess s s fo fo for r r Co Co orr rr rres es e p po pond nd nden e ce ce ce:
متن کاملAmbiguity under Changing Contexts
Notions of disambiguation supporting a compositional interpretation of ambiguous expressions and reeecting intuitions about how sentences combine in discourse are investigated. Expressions are analyzed both inductively by breaking them apart, and co-inductively by embedding them within larger contexts.
متن کاملA Tutorial on Co-induction and Functional Programming
Co-induction is an important tool for reasoning about unbounded structures. This tutorial explains the foundations of co-induction, and shows how it justiies intuitive arguments about lazy streams, of central importance to lazy functional programmers. We explain from rst principles a theory based on a new formulation of bisimilarity for functional programs, which coincides exactly with Morris-s...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Electr. Notes Theor. Comput. Sci.
دوره 26 شماره
صفحات -
تاریخ انتشار 1999